feat: support DinD install for Amazon Linux 2023#5
Conversation
Signed-off-by: Giles Cope <gilescope@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request extends the DinD (Docker-in-Docker) installation script to officially support Amazon Linux 2023. It introduces specific package management commands ( Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for installing Docker-in-Docker on Amazon Linux 2023. The changes correctly use dnf for package management on this new OS version, and update the test matrix accordingly. My review includes a suggestion to refactor duplicated code into a helper function to improve maintainability.
| } | ||
|
|
||
| install_jq_amazon() { | ||
| version=$(sed -n -e 's/^VERSION="\?\([^\"]*\)"\?/\1/p' /etc/os-release) |
There was a problem hiding this comment.
The command to get the Amazon Linux version is duplicated in install_dockerd_amazon, install_jq_amazon, and clean_after_install_amazon. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, this logic should be extracted into a helper function. This new function can then be called from all three places.
For example, you could add a helper function:
get_amazon_version() {
sed -n -e 's/^VERSION=\"\?([^\"]*)\"\?/\1/p' /etc/os-release
}And then call it like this:
version=$(get_amazon_version)This change should also be applied to install_dockerd_amazon and clean_after_install_amazon.
No description provided.